/*
 * @Author: 噜噜雯雯 2199987619@qq.com
 * @Date: 2025-07-24 15:52:40
 * @LastEditors: 噜噜雯雯 2199987619@qq.com
 * @LastEditTime: 2025-09-28 10:00:51
 * @FilePath: \linePatrol\vue-element-plus-admin\src\views\EquipManage\EquipType\components\type.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import type { VNode } from 'vue'

// 表单元素配置类型
export interface FormComponentConfig {
  tag: string
  formId?: string
  span?: number
  label?: string
  labelWidth?: number
  required?: boolean
  renderKey?: string | number
  defaultValue?: any
  layout?: string
  type?: string
  justify?: string
  align?: string
  gutter?: number
  componentName?: string
  children?: FormComponentConfig[]
  options?: Array<{
    label: string
    value: string | number
    disabled?: boolean
  }>
  optionType?: 'button' | 'default'
  border?: boolean
  'list-type'?: string
  showTip?: boolean
  fileSize?: number
  sizeUnit?: string
  accept?: string
  buttonText?: string
  [key: string]: any
}

export interface FormConfig {
  unFocusedComponentBorder?: boolean
  [key: string]: any
}

export type LayoutFunction = (
  element: FormComponentConfig,
  index: number,
  parent: FormComponentConfig[]
) => VNode | VNode[]

export interface ComponentChild {
  [key: string]: {
    [key: string]: (
      h: typeof import('vue').h,
      conf: FormComponentConfig,
      key: string
    ) => VNode | VNode[]
  }
}
